package kotlindemo.com.kotlindemo

import java.lang.IllegalArgumentException
//第四章 延迟初始化与密封类
fun main(args: Array<String>){
//    var result=Result();
//    getResultMsg(result)
    //扩展函数
    var count="ABC12345xyz$%2".lettersCount()
    println("总共有：${count}个字母")
}
//fun getResultMsg(result: Result) = when (result) {
//    is Success ->result.msg
//    is Success ->result.msg
//    else ->throw IllegalArgumentException()
//}